read_data;

%% set parameters

% externally calibrated parameters
R=1/1.02;
beta=1/R;
T=12; % duration of investment period

J_D=80; % live until 80
J_R=65; % retire at 65

% lifecycle wage profile
param_W_m=[.0299229 -.0005837]';
param_W_f=[.053901 -.0008693]';

% estimated technology parameters (Table 5, kappa=0)
rho=1-1/0.2;
gma=1-1/0.5;

delta1=0.13;
delta2=0.83;

phi_m=[8.32 0.07 -0.96 -2.41 -0.52 -1.73 -0.61 0.49]';
phi_f=[4.24 -0.49 0.66 -1.07 -0.98]';
phi_Y=[-1.21 0.61 0.08 0.1 0 -0.23 -0.07 0.07 -0.01 -0.64]';
phi_theta=[1.32-0.34 -0.15 0.04 -0.3 0.09 -0.03 -0.14 0.08 0.01 0.21]';

% preference parameters to calibrate
alpha=zeros(N,1);
psi_m=zeros(N,1);
psi_f=zeros(N,1);
share_model_age=zeros(2,2,T,3);

%% start running
set_regressors;
calculate_PDV;

if calibration
    calibrate;
else
    read_parameters;
end    

if decomposition
    decompose;
elseif price_reduction
    reduce_price;
end
